package main

import "fmt"

type Phone interface {
	// 输出收集的基本信息
	call()
	// 输出手机的价格
	getPrice()
}

type HuaWeiPhone struct {
	name     string
	location string
	price    float32
}

type IPhone struct {
	name     string
	location string
	price    float32
}

func (iPhone IPhone) go () {
	fmt.Printf("Phone name: %s\nPhone location: %s\nPhone Price: %.2f\n\n", iPhone.name, iPhone.location, iPhone.price)
}

func (hwPhone HuaWeiPhone) call() {
	fmt.Printf("Phone name: %s\nPhone location: %s\nPhone Price: %.2f\n\n", hwPhone.name, hwPhone.location, hwPhone.price)

}

func (iPhone IPhone) getPrice() {
	fmt.Printf("IPhone price: %.2f\n\n", iPhone.price)
}

func (hwPhone HuaWeiPhone) getPrice() {
	fmt.Printf("HuaWeiPhone price: %.2f\n\n", hwPhone.price)
}

func main() {
	iPhone := IPhone{name: "IPhone", location: "America", price: 4399}
	hwPhone := HuaWeiPhone{name: "HuaWeiPhone", location: "China", price: 4199}
	iPhone.call()
	iPhone.getPrice()

	hwPhone.call()
	hwPhone.getPrice()

}
